*** OPEN LOG/OUTPUT FILE ***

log using "C:\Users\gk57526\Dropbox\Executive Particularism (Matt Zarit)\Cooperative Agreements\Empirics\OCTOBER 2020\Output\cooperativeagreements.UQFE.SUPPLEMENTARY ANALYSIS #3.11-14-2020.smcl", replace



**** ACCESS DATABASE ***

use "C:\Users\gk57526\Dropbox\Executive Particularism (Matt Zarit)\Cooperative Agreements\Empirics\OCTOBER 2020\Data\cooperativeagreements.grantlevel.MANUSCRIPT MODELS.11-06-2020.dta", replace



**************************************************************************************************************************************************************************************
**************************************************************************************************************************************************************************************
**************************************************************************************************************************************************************************************
**************************************************************************************************************************************************************************************
**************************************************************************************************************************************************************************************
**************************************************************************************************************************************************************************************

*** CREATE THE EFFECTIVE SAMPLE FROM THE REGRESSION MODELS ESTIMATED IN THE MANUSCRIPT ***

quietly xtrifreg fed_funding   zpolicy2_abszero zmanage2_abszero ceo  privmgt  pctagency_packing perc_prof nongov_recip  ///
zloyalty2_abszero  electionyear unified pres_party house_majority any_chair house_app house_ways lnnewpop pctpoverty pcincomecd   action_a action_b ///
ln_l1_recip_grantamt ln_l2_recip_grantamt ln_l3_recip_grantamt  ///
year_89 year_90 year_91 year_92 year_93 year_94  year_95 year_96 year_97 year_98 year_99 year_00 year_01 year_02 year_03 year_04 year_05 year_06 year_07 year_08, ///
fe i(subagency) q(05)


**************************************************************************************************************************************************************************************
**************************************************************************************************************************************************************************************
**************************************************************************************************************************************************************************************
**************************************************************************************************************************************************************************************
**************************************************************************************************************************************************************************************
**************************************************************************************************************************************************************************************



*** 1. EVALUATE THE BETWEEN/WITHIN VARIATION IN (1) CA AWARD SIZE & (2) AGENCY HEAD POLICY EXPERTISE TO DETERMINE WHETHER THE VARIATION IS DOMINATED BY BETWEEN-(SUB)AGENCY LEVEL ///
***    VARIATION AND THUS HAS INSUFFICIENT WITHIN-AGENCY VARIATION --- AN ADDITIONAL CHECK BESIDES THE (SUB)AGENCY UNIT EFFECTS SPECIFIED IN THE REGRESSION MODEL SPECIFICATIONS ***


*** DEFINE (SUB)AGENCY AS PANEL IDENTIFIER TO PERFORM PANEL DESCRIPTIVE STATISTICS ***

xtset subagency



*** 1A. COMPUTE PANEL DESCRIPTIVE STATISTICS FOR CA AWARD SIZE [actual constant $ & natural logarithm of actual constant $]***

xtsum fed_funding if e(sample)
*
display 1015941 / 2899066
*
*
xtsum ln_fed_funding if e(sample)
*
display 1.386188 / 1.80698



*** 1B. COMPUTE PANEL DESCRIPTIVE STATISTICS FOR AGENCY POLICY HEAD EXPERTISE ***

xtsum zpolicy2_abszero if e(sample)
*
display 0.691824 / 0.6338932


*** NOTE: There is clearly sufficient between and within-(sub)agency variation in both CA award sizes and Agency Head Policy Expertise *** 


**************************************************************************************************************************************************************************************
**************************************************************************************************************************************************************************************
**************************************************************************************************************************************************************************************
**************************************************************************************************************************************************************************************
**************************************************************************************************************************************************************************************
**************************************************************************************************************************************************************************************

*** 2. EVALUATING BALANCE IN BINARY INDICATORS TO AVOID LOW POWER TESTS ***  

tab ceo if e(sample)
*
tab privmgt if e(sample)
*
tab electionyear if e(sample)
*
tab unified if e(sample)
*
tab pres_party if e(sample) 
*
tab house_majority if e(sample)
*
tab any_chair if e(sample)
*
tab house_app if e(sample)
*
tab house_ways if e(sample)
*
tab action_a if e(sample)
*
tab action_b if e(sample)


**************************************************************************************************************************************************************************************
**************************************************************************************************************************************************************************************
**************************************************************************************************************************************************************************************
**************************************************************************************************************************************************************************************
**************************************************************************************************************************************************************************************
**************************************************************************************************************************************************************************************


*** 3. COMPUTE PERCENTAGE OF CA AWARDS UNDERTAKEN FOR RECESS PRESIDENTIAL APPOINTED (SUB)AGENCY HEADS [Only 98 CA Awards out of 241,730: 0.04%]***

tab recess if e(sample)



****Supplementary Analysis # 3 (Linear Trends in CA Award Size and Agency Head Policy Expertise: Bivariate Linear Prediction Fits) Full Sample, plus disaggregated by partner recipient types.***

***ALL CAs***
twoway (lfitci ln_fed_funding year if e(sample), ytitle(Log of CA Awards) ytitle(, margin(small)) xtitle(Year) title(FIGURE SI-3.1: Relationship Between CA Award Size & Agency Head Policy Expertise With Respect to Time, size(small))  subtitle(Full Sample, size(small)) legend(off) scheme(sj)) (lfitci zpolicy2_abszero year if e(sample), yaxis(2))
*
save "C:\Users\gk57526\Dropbox\Executive Particularism (Matt Zarit)\Cooperative Agreements\Empirics\OCTOBER 2020\Output\Graphics\Supplementary Analysis 3\Figure SI-3.1.gph", replace


***Government Partner***

twoway (lfitci ln_fed_funding year if e(sample) & gov_recip==1, ytitle(Log of CA Awards) ytitle(, margin(small)) xtitle(Year) title(FIGURE SI-3.2: Relationship Between CA Award Size & Agency Head Policy Expertise With Respect to Time, size(small)) subtitle(Government Partner, size(small)) legend(off) scheme(sj)) (lfitci zpolicy2_abszero year if e(sample) & gov_recip==1, yaxis(2))
*
save "C:\Users\gk57526\Dropbox\Executive Particularism (Matt Zarit)\Cooperative Agreements\Empirics\OCTOBER 2020\Output\Graphics\Supplementary Analysis 3\Figure SI-3.2.gph", replace


***Non-Governmental Partner***

twoway (lfitci ln_fed_funding year if e(sample) & gov_recip==0, ytitle(Log of CA Awards) ytitle(, margin(small)) xtitle(Year) title(FIGURE SI-3.3: Relationship Between CA Award Size & Agency Head Policy Expertise With Respect to Time, size(small)) subtitle(Non-Government Partner, size(small))  legend(off) scheme(sj)) (lfitci zpolicy2_abszero year if e(sample) & gov_recip==0, yaxis(2))
*
save "C:\Users\gk57526\Dropbox\Executive Particularism (Matt Zarit)\Cooperative Agreements\Empirics\OCTOBER 2020\Output\Graphics\Supplementary Analysis 3\Figure SI-3.3.gph", replace


***Nonprofit Partner***

twoway (lfitci ln_fed_funding year if e(sample) & nonprofit_recip==1, ytitle(Log of CA Awards) ytitle(, margin(small)) xtitle(Year) title(FIGURE SI-3.4: Relationship Between CA Award Size & Agency Head Policy Expertise With Respect to Time, size(small)) subtitle(Nonprofit Partner, size(small))  legend(off) scheme(sj)) (lfitci zpolicy2_abszero year if e(sample) & nonprofit_recip==1, yaxis(2))
*
save "C:\Users\gk57526\Dropbox\Executive Particularism (Matt Zarit)\Cooperative Agreements\Empirics\OCTOBER 2020\Output\Graphics\Supplementary Analysis 3\Figure SI-3.4.gph", replace


***Private Sector Partner***

twoway (lfitci ln_fed_funding year if e(sample) & private_recip==1, ytitle(Log of CA Awards) ytitle(, margin(small)) xtitle(Year) title(FIGURE SI-3.5: Relationship Between CA Award Size & Agency Head Policy Expertise With Respect to Time, size(small)) subtitle(Private Sector Partner, size(small))  legend(off) scheme(sj)) (lfitci zpolicy2_abszero year if e(sample) & private_recip==1, yaxis(2))
*
save "C:\Users\gk57526\Dropbox\Executive Particularism (Matt Zarit)\Cooperative Agreements\Empirics\OCTOBER 2020\Output\Graphics\Supplementary Analysis 3\Figure SI-3.5.gph", replace



log close
